package com.xuwang.controller;

import com.xuwang.service.impl.GovernmentInformServiceGGImpl;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.Map;

/**
 * @ClassName GovernmentInformController
 * @Description TODO
 * @Author gongzihao
 * @Date 2021/9/16 16:05
 */
@Api(value = "GovernmentInformController",tags = "通知公告接口")
@RestController
public class GovernmentInformController {

    @Resource
    GovernmentInformServiceGGImpl governmentInformGGService ;

    @PostMapping("/insertInform")
    public Map<String, Object> insertInform(String inform){


        return governmentInformGGService.insertInform(inform);
    }

    @GetMapping("/selecrInform")
    public Map<String, Object> selecrInform(String inform,String informDay,
                                            String page,String limit
                                            ){
        int pageAsInt = Integer.parseInt(page);
        int limitAsInt = Integer.parseInt(limit);

        return governmentInformGGService.selectAll(inform,informDay,pageAsInt,limitAsInt);
    }
}
